package cn.zjnu.struts;

import java.sql.SQLException;

import cn.zjnu.DAO.Dao;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{
	private String UserId;
	private String Pwd;
	private String Type;
	Dao User =new Dao();
	public String getUserId() {
		return UserId;
	}
	public void setUserId(String userId) {
		UserId = userId;
	}
	public String getPwd() {
		return Pwd;
	}
	public void setPwd(String pwd) {
		Pwd = pwd;
	}
	public String getType() {
		return Type;
	}
	public void setType(String type) {
		Type = type;
	}
	public String execute () throws ClassNotFoundException, SQLException{
		User.connect();
		if(User.login(UserId, Pwd, Type))
		return this.SUCCESS;
		else return this.ERROR;
		
	}

}
